package demo4;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.math.RoundingMode;

@Data
@NoArgsConstructor


public class Drink
{
    private String name;
    private int  weight;
    private int value;
    private double One_value;
    public Drink(String name,int weight,int value)
    {
        this.name=name;
        this.weight=weight;
        this.value=value;
        BigDecimal bd1 =BigDecimal.valueOf(this.weight);
        BigDecimal bd2 =BigDecimal.valueOf(this.value);
        this.One_value=bd2.divide(bd1,2, RoundingMode.HALF_UP).doubleValue();
    }
}
